<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\JumpConfig\validate;

use think\Validate;

/**
 * 服务入口验证器
 */
class JumpConfigValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'icon' => 'require',
        'name_zh' => 'require',
        'name_en' => 'require',
        'name_ja' => 'require',
        'name_ko' => 'require',
        'appid' => 'require',
        'path' => 'require'
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'icon' => '服务图标必须填写',
        'name_zh' => '服务标题中文必须填写',
        'name_en' => '服务标题英文必须填写',
        'name_ja' => '服务标题日语必须填写',
        'name_ko' => '服务标题韩文必须填写',
        'appid' => '小程序app_id必须填写',
        'path' => '小程序跳转链接必须填写'
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'icon',
            'name_zh',
            'name_en',
            'name_ja',
            'name_ko',
            'appid',
            'path'
        ],
        'update' => [
            'icon',
            'name_zh',
            'name_en',
            'name_ja',
            'name_ko',
            'appid',
            'path'
        ],
    ];

}
